// 引入 G6 主库
import G6 from "@antv/g6/build/g6";
// 引入自定义行为模块
import hoverNode from './hover-node'
import addLine from './add-edge'
import dragItem from './drag-item'
import selectNode from './select-node'
import hoverEdge from "./hover-edge";
import keyboard from './keyboard'
import mulitSelect from './mulit-select'
import addMenu from './add-menu'

// 行为注册表，key 为行为名，value 为行为实现对象
const behavors = {
    'hover-node': hoverNode,      // 节点悬浮
    'add-edge': addLine,         // 添加边
    'drag-item': dragItem,       // 拖动节点
    'select-node': selectNode,   // 选择节点
    'hover-edge': hoverEdge,     // 边悬浮
    'keyboard':keyboard,         // 键盘快捷键
    'mulit-select':mulitSelect,  // 框选多选
    'add-menu':addMenu           // 右键菜单
}

// 初始化并注册所有自定义行为到 G6
export function initBehavors() {
    for (let key in behavors) {
        console.log('初始化并注册所有自定义行为到 G6',key);
        
        G6.registerBehavior(key, behavors[key])
    }
}


